package com.laamella.syntherface.synths.alesis.micron.gui;

import com.laamella.syntherface.synths.alesis.micron.model.Voice;

public class FmPanel extends javax.swing.JPanel {

	private static final long serialVersionUID = 1L;

    public void setModel(Voice voice) {
		levelSlider.setModel(voice.fmAmount);
		linExpButtonGroup.setModel(voice.fmExponentialDerived);
		fmTypeButtonGroup.setModel(voice.fmTypeDerived);
	}

    /** Creates new form FmPanel */
    public FmPanel() {
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        fmTypeButtonGroup = new com.laamella.syntherface.synths.gui.RotaryButtonGroup();
        linExpButtonGroup = new com.laamella.syntherface.synths.gui.RotaryButtonGroup();
        fmType21Button = new javax.swing.JRadioButton();
        fmType213Button = new javax.swing.JRadioButton();
        fmType321Button = new javax.swing.JRadioButton();
        jLabel1 = new javax.swing.JLabel();
        levelSlider = new javax.swing.JSlider();
        linearButton = new javax.swing.JRadioButton();
        exponentialButton = new javax.swing.JRadioButton();

        setBackground(new java.awt.Color(153, 255, 255));
        setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0), 3));
        setLayout(null);

        fmTypeButtonGroup.add(fmType21Button);
        fmType21Button.setText("2>1");
        fmType21Button.setOpaque(false);
        add(fmType21Button);
        fmType21Button.setBounds(10, 30, 45, 23);

        fmTypeButtonGroup.add(fmType213Button);
        fmType213Button.setText("2>1<3");
        fmType213Button.setOpaque(false);
        add(fmType213Button);
        fmType213Button.setBounds(10, 50, 59, 23);

        fmTypeButtonGroup.add(fmType321Button);
        fmType321Button.setSelected(true);
        fmType321Button.setText("3>2>1");
        fmType321Button.setOpaque(false);
        add(fmType321Button);
        fmType321Button.setBounds(10, 70, 59, 23);

        jLabel1.setFont(new java.awt.Font("Tahoma", 1, 18));
        jLabel1.setText("FM");
        add(jLabel1);
        jLabel1.setBounds(10, 10, 26, 22);

        levelSlider.setOpaque(false);
        add(levelSlider);
        levelSlider.setBounds(40, 10, 110, 24);

        linExpButtonGroup.add(linearButton);
        linearButton.setText("linear");
        linearButton.setOpaque(false);
        add(linearButton);
        linearButton.setBounds(70, 40, 80, 23);

        linExpButtonGroup.add(exponentialButton);
        exponentialButton.setText("exponential");
        exponentialButton.setOpaque(false);
        add(exponentialButton);
        exponentialButton.setBounds(70, 60, 90, 23);
    }// </editor-fold>//GEN-END:initComponents

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JRadioButton exponentialButton;
    private javax.swing.JRadioButton fmType213Button;
    private javax.swing.JRadioButton fmType21Button;
    private javax.swing.JRadioButton fmType321Button;
    private com.laamella.syntherface.synths.gui.RotaryButtonGroup fmTypeButtonGroup;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JSlider levelSlider;
    private com.laamella.syntherface.synths.gui.RotaryButtonGroup linExpButtonGroup;
    private javax.swing.JRadioButton linearButton;
    // End of variables declaration//GEN-END:variables


}
